# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=enteletaor
pkgver=68.a975b5c
_pyver=3.13
pkgrel=7
groups=('blackarch' 'blackarch-exploitation' 'blackarch-scanner'
        'blackarch-recon')
pkgdesc='Message Queue & Broker Injection tool that implements attacks to Redis, RabbitMQ and ZeroMQ.'
arch=('any')
url='https://github.com/cr0hn/enteletaor'
license=('BSD')
depends=('python' 'python-six' 'python-lxml' 'python-wtforms' 'python-eventlet'
         'python-colorlog' 'python-requests' 'python-netaddr' 'python-amqp'
         'python-redis' 'python-kombu' 'python-celery' 'python-pyzmq'
         'python-future' 'python-markupsafe')
makedepends=('git' 'python-setuptools')
source=("git+https://github.com/cr0hn/$pkgname.git"
        'requirements.txt.patch')
sha512sums=('SKIP'
            '7fedde239ce3ce537cd62e87b6b43e4d39ccdcfd3e0da4bdffca2a5eb166e301e4e785ea448660c3ce313d18dbac79952ea74ca533dbb0250e7b00214874c148')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  patch -p1 < requirements.txt.patch
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.rst CHANGELOG
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  mv "$pkgdir/usr/bin/${pkgname}3" "$pkgdir/usr/bin/$pkgname"

  rm -rf "$pkgdir/usr/lib/python$_pyver/site-packages/doc"
}

